Skip to content

Conversation

@Chibionos
Copy link
Contributor

@Chibionos Chibionos commented Jan 9, 2026

Summary

Adds support for suspend/resume pattern in evaluation runtime, enabling agents to suspend execution when invoking RPA processes and resume after completion.

Key Changes

Suspend Detection (_runtime.py)

  • Runtime detects UiPathRuntimeStatus.SUSPENDED after agent execution
  • Extracts trigger information from suspended executions
  • Skips evaluators during suspension (evaluators only run on SUCCESSFUL completion)
  • Returns triggers in partial results for resume context

Resume Support (cli_eval.py)

  • Added --resume flag to evaluation CLI
  • Loads checkpoint state and continues from interruption point
  • Passes resume context to runtime

Trigger Pass-Through

  • Suspended executions return triggers with structure:
    • interruptId: Unique interrupt identifier
    • triggerType: Type of trigger (e.g., "Api")
    • payload: InvokeProcess details (process name, input arguments, folder path)

Comprehensive Logging

  • Suspension detection events (🔴 DETECTED SUSPENSION)
  • Trigger extraction details (📋 Extracted N trigger(s))
  • Evaluator skip reasons (⏭️ Skipping evaluators)
  • Trigger pass-through confirmation (✅ Passing through triggers)
  • Resume mode indication (🟢 RESUMED execution)

Testing

Testing is done via the sample agent in the companion PR: UiPath/uipath-langchain-python#397

Related

Companion PR for sample agent: UiPath/uipath-langchain-python#397

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Jan 9, 2026
@Chibionos
Copy link
Contributor Author

Quick Testing Guide

Install the Dev Version

pip install git+https://github.com/UiPath/[email protected]

Run Quick Test

cd samples/event-trigger

# Test 1: Direct runtime test
python -c "
import asyncio
from uipath.functions.runtime import UiPathFunctionsRuntime

async def test():
    runtime = UiPathFunctionsRuntime(
        'test_suspend_resume_agent.py',
        'main', 
        'test_suspend_resume_agent'
    )
    result = await runtime.execute({'query': 'Test'})
    print(f'✓ Status: {result.status}')
    print(f'✓ Has Trigger: {result.trigger is not None}')
    if result.trigger:
        print(f'✓ Process: {result.trigger.payload[\"process_name\"]}')

asyncio.run(test())
"

# Test 2: Evaluation test
uipath eval test_suspend_resume_agent evaluations/test_suspend_resume.json --output-file test_output.json
cat test_output.json | python -m json.tool | grep -A 5 "status"

Expected Results

Status: SUSPENDED
Trigger exists with process name and arguments
Evaluation output shows suspended state in JSON

Key Files Changed

  • Functions Runtime: src/uipath/functions/runtime.py (+70 lines)

    • New _detect_langgraph_interrupt() method
    • Trigger extraction from __interrupt__ field
  • Evaluation Runtime: src/uipath/_cli/_evals/_runtime.py (+58 lines)

    • SUSPENDED status detection
    • Skip evaluators when suspended
    • Publish suspended event
  • Test Agent: samples/event-trigger/test_suspend_resume_agent.py (new file)

    • Demonstrates correct interrupt pattern
    • Uses checkpointer and returns raw dict

Tag: v2.4.9-dev.suspend-resume
Branch: investigate-rpa-samples

@Chibionos Chibionos changed the title feat: Add suspend/resume support for RPA invocations in evaluations feat: add suspend/resume support for RPA invocations in evaluations Jan 10, 2026
@Chibionos Chibionos force-pushed the investigate-rpa-samples branch from 0a124f0 to a35d2a5 Compare January 12, 2026 15:26
@mjnovice
Copy link
Contributor

Just to understand, so the suspend and resume is actually being done by the agent and not the orchestrator, right ?

from uipath.runtime.errors import (
UiPathErrorCategory,
UiPathErrorCode,
UiPathErrorContract,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to undo everything in this file (this is used for arbitrary python code, no langgraph deps)


result = UiPathRuntimeResult(
output={**results.model_dump(by_alias=True)},
status=UiPathRuntimeStatus.SUCCESSFUL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the runtime is suspended, you need to pass the result as suspended to the serverless exector

This commit consolidates changes for suspend/resume functionality:

- Add suspend/resume support for RPA invocations in evaluations
- Add --resume option and trigger pass-through to eval runtime
- Add comprehensive logging for suspend/resume detection
- Add architecture documentation for interrupt/suspend/resume patterns
- Add Claude Code skills for agents
- Add content_tokens and argument_properties to agent model
- Expose more configs in manager
- Add documents samples
- Fix linting issues in functions runtime
- Remove deprecated hello-world sample
- Update evaluation spans with output attributes and metadata

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@Chibionos Chibionos force-pushed the investigate-rpa-samples branch from a35d2a5 to c2548d0 Compare January 15, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants